<?php
use yii\helpers\Url;
use yii\widgets\LinkPager;
use yii\helpers\Html;
use common\helpers\HtmlHelper;

$this->title = '商铺';
$this->params['breadcrumbs'][] = ['label' => '客户列表', 'url' => ['merchant/index']];
$this->params['breadcrumbs'][] = ['label' => $this->title];
?>

<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title"><?= $this->title; ?></h3>
                <div class="box-tools">
                    <?= HtmlHelper::create(['ajax-edit', 'member_id' => $member_id], '创建', [
                        'data-toggle' => 'modal',
                        'data-target' => '#ajaxModal',
                    ])?>
                </div>
            </div>
            <div class="box-body table-responsive">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>商铺名称</th>
                        <th>Logo</th>
                        <th>账户金额</th>
                        <th>详细地址</th>
<!--                        <th>状态</th>-->
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach($models as $model){ ?>
                        <tr id="<?= $model->id ?>">
                            <td><?= $model->id ?></td>
                            <td><?= Html::encode($model->name) ?></td>
                            <td>
                                <?= HtmlHelper::imageFancyBox($model->logo)?>
                            <td>
                                <p>余额：<?= $model->money?></p>
                                <p>累计：<?= $model->accumulate_money?></p>
                                <p>冻结：<?= $model->frozen_money?></p>
                            </td>
                            <td><?= $model->address_name ?><?= $model->address_detail ?></td>
<!--                            <td>-->
<!--                                --><?//= HtmlHelper::showStatus($model['status']); ?>
<!--                            </td>-->
                            <td><?= Yii::$app->formatter->asDatetime($model->created_at)?></td>
                            <td>
                                <?= HtmlHelper::linkButton(['brand/index', 'store_id'=>$model->id],'品牌')?>
                                <?= HtmlHelper::linkButton(['goods/gc', 'store_id'=>$model->id],'分类')?>
                                <?= HtmlHelper::linkButton(['goods/index', 'store_id'=>$model->id],'商品')?>
                                <?= HtmlHelper::edit(['ajax-edit', 'id' => $model->id, 'member_id' => $member_id], '编辑', [
                                    'data-toggle' => 'modal',
                                    'data-target' => '#ajaxModal',
                                ])?>
                                <?= HtmlHelper::status($model['status']); ?>
                                <?= HtmlHelper::delete(['destroy','id' => $model->id, 'member_id' => $member_id])?>
                            </td>
                        </tr>
                    <?php } ?>
                    </tbody>
                </table>
            </div>
            <div class="box-footer">
                <?= LinkPager::widget([
                    'pagination' => $pages
                ]);?>
            </div>
        </div>
    </div>
</div>
